package com.atgm.mall.gmmallclub.scheduled.job;

import com.atgm.mall.gmmallclub.service.ArticleService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @ClassName ArticleTaskScheduler
 * @Description 文章定时任务调度
 * @Auther pdx
 * @Date 2021/11/2 16:20
 * @Verison 1.0
 **/
@Slf4j
@Component
public class ArticleTaskJob extends QuartzJobBean {

    @Autowired
    private ArticleService articleService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("开始更新最热贴信息");
        articleService.updateHotArticleList();
        log.info("结束更新最热贴信息");
    }


}
